/*
 * Copyright 2008-2009 Daniel Freitas
 * 
 * This file is part of Army Creator.
 * 
 * Army Creator is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * Army Creator is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with Army Creator. If not, see
 * <http://www.gnu.org/licenses/>.
 */
package com.googlecode.armycreator.gui.link;

import java.util.HashSet;

import org.apache.wicket.markup.html.link.Link;

import com.googlecode.armycreator.domain.Army;
import com.googlecode.armycreator.domain.GameSystem;
import com.googlecode.armycreator.dto.RosterDto;
import com.googlecode.armycreator.gui.page.CreateNewRosterPage;
import com.googlecode.armycreator.gui.presenter.RosterPresenter;

public class CreateNewRosterLink extends Link<Object> {

    private RosterPresenter rosterPresenter;

    public CreateNewRosterLink(String id, RosterPresenter rosterPresenter) {
        super(id);
        this.rosterPresenter = rosterPresenter;
    }

    @Override
    public void onClick() {
        HashSet<GameSystem> availableGameSystems = new HashSet<GameSystem>();

        GameSystem gameSystem = new GameSystem.Builder().name("Warhammer 40k").build();
        Army army2 = new Army.Builder().name("Space Marines").build();
        gameSystem.addArmy(army2);
        Army army1 = new Army.Builder().name("Imperial Guard").build();
        gameSystem.addArmy(army1);

        GameSystem gameSystem2 = new GameSystem.Builder().name("Warhammer").build();
        Army army4 = new Army.Builder().name("Empire").build();
        gameSystem2.addArmy(army4);
        Army army3 = new Army.Builder().name("High Elves").build();
        gameSystem2.addArmy(army3);

        availableGameSystems.add(gameSystem);
        availableGameSystems.add(gameSystem2);

        setResponsePage(new CreateNewRosterPage(new RosterDto(), availableGameSystems, rosterPresenter));
    }

    private static final long serialVersionUID = 6011021090248318199L;
}